# idris-cbind

Generates Idris bindings to C libraries from Doxygen XML.

Project Status: WIP, unusable.

All we have for now is a complete (but untested) parser for Doxygen XML files.

## Building

Building and running only requires `sbt`.

`$ sbt run`

### Why isn't this on GitHub?

This repo contains a patched version of a proprietary XML library that bypasses
the developers's licensing mechanism. The risk of GitHub deleting this repo due
to copyright violation is too high.

### But pirating software is bad!

Yeah, I know. I tried about a dozen free XML parser generator libraries, but none
of them worked. Finally my frustration overruled my moral sense. But I'm not making
any money off this so I kinda feel less guilty.

### Re-patching the XML library for updates

1. Get access to a Windows machine and install the latest version of the Liquid XML Data Binder.
2. Copy `C:\Program Files\Liquid Technologies\Liquid Studio 2020\XmlDataBinder18\Redist18\Java\JDK5\ltxmllib18.jar`
   to `<this repo>/ltxml/ltxmllib18-unpatched.jar`
3. `make disassemble-ltxml`
4. Replace the beginning of the `<clinit>` method in `ltxml/src/com/liquid_technologies/ltxmllib18/k.j`
   with the following:

   ```
   .method static <clinit> : ()V 
       .code stack 1 locals 0 
   L0:     iconst_1 
   ```

   Leave everything below the line starting with `L0:` as is.

5. `make assemble-ltxml`
